
****************************************************************
****************************************************************
***** THIS FILE GENERATES histogram of resubmission costs ******
****************************************************************
****************************************************************

cap log close 

di "This run uses code version from 2023/03/29"

use `"$output/model_estimation/estimations_bin.dta"', clear 


drop if claim_cost_se == 0 
sum claim_cost, d 
drop if claim_cost > r(p99)

replace claim_cost = - claim_cost

histogram claim_cost if pay_type==1 , percent width(1) name(medicare)
*graph export `"$output/paper_inputs/rescos_medicare.pdf"', replace 
graph export `"rescos_medicare.pdf"', replace 


histogram claim_cost if pay_type==2 , percent width(1) name(medicaid)
*graph export `"$output/paper_inputs/rescos_medicaid.pdf"', replace 
graph export `"rescos_medicaid.pdf"', replace 


histogram claim_cost if pay_type==3 , percent width(1) name(commercial)
*graph export `"$output/paper_inputs/rescos_commercial.pdf"', replace 
graph export `"rescos_commercial.pdf"', replace 





